package com.p2p.quartz;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;

import com.p2p.bill.service.BillService;

public class BillJob {
	
	@Autowired
	private BillService billService;
	public void start() {

		try {
		
			Date date = new Date();
			Date date1 = new Date(date.getTime() - 24*60*60*1000);
			SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd 23:00:00");
			String str = format.format(date1);
			billService.putbill(str);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
